/*
 *  mih_tlv.h
 *  MIHF
 *
 *  Created by injae song on 11. 3. 4..
 *  Copyright 2011 KyungHee Univ. All rights reserved.
 *
 */

#ifndef MIH_TLV_H
#define MIH_TLV_H

#include "mih_type.h"

/*************************************
 * Type Value for TLV encoding *
 *************************************/

typedef enum _tlv_type {
	///Source MIHF ID
	MIHF_ID_SRC_TYPE = 1,
	///Destination MIHF ID
	MIHF_ID_DST_TYPE=2,
	///Status
	STATUS_TYPE=3,
	///Link type  
	LINK_TYPE=4,
	///MIH event list
	MIH_EVT_LIST_TYPE=5,
	///MIH command list
	MIH_CMD_LIST_TYPE=6,
	///MIIS query type list
	MIH_IQ_TYPE_LST_TYPE=7,
	///Transport option list
	MIH_TRANS_LST_TYPE=8,
	///Link address list
	MIH_ADDR_LIST_TYPE=9,
	///MBB handover support
	MBB_HO_SUPP_LIST_TYPE=10,
	///Register request code
	REG_REQUEST_CODE_TYPE=11,
	///Valid time interval 12 
	VALID_TIMEINT_TYPE=12,
	///Link identifier
	LINK_TUPLE_ID_TYPE=13,
	///New link identifier
	NEW_LINK_TUPLE_ID_TYPE=14,
	///Old access router
	OLD_ACCESS_ROUTER_LINK_ADDR_TYPE=15,
	///New access router
	NEW_ACCESS_ROUTER_LINK_ADDR_TYPE=16,
	///IP renewal flag
	IP_RENEWAL_FLAG_TYPE=17,
	///Mobility management support
	IP_MOB_MGMT_TYPE=18,
	///IP address configuration methods
	IP_CFG_MTHDS_TYPE=19,
	///Link down reason code
	LINK_DN_REASON_TYPE=20,
	///Time interval
	TIMEINT_TYPE=21,
	///Link going down reason
	LINK_GD_REASON_TYPE=22,
	///Link parameter report list
	LINK_PARAM_RPT_LIST_TYPE=23,
	///Device states request
	DEV_STATES_REQ_TYPE=24,
	///Link identifier list
	LINK_ID_LIST_TYPE=25,
	///Device states response list
	DEV_STATES_RSP_LIST_TYPE=26,
	///Get status request set
	LINK_STATUS_REQ_TYPE=27,
	///Get status response list
	GET_STATUS_REPORT_LIST_TYPE=28,
	///Configure request list
	CONFIGURE_REQUEST_LIST_TYPE=29,
	///Configure response list
	CONFIGURE_RESPONCE_LIST_TYPE=30,
	///List of link PoA list
	LINK_POA_LIST_TYPE=31,
	///Preferred link list
	PREFERRED_LINK_LIST_TYPE=32,
	///Handover resource query list
	HO_RESOURCE_LIST_TYPE=33,
	///Handover status
	HO_STATUS_TYPE=34,
	///Access router address
	ACCESS_ROUTER_IP_ADDR_TYPE=35,
	///DHCP server address
	DHCP_SERVER_IP_ADDR_TYPE=36,
	///FA address
	FA_IP_ADDR_TYPE=37,
	///IP address information status
	IP_INFO_STATUS_TYPE=38,
	///Link actions list
	LINK_ACTION_REQ_LIST_TYPE=39,
	///Link actions result list
	LINK_ACTION_RSP_LIST_TYPE=40,
	///Handover result
	HO_RESULT_TYPE=41,
	///Resource status
	LINK_RES_STATUS_TYPE=42,
	///Resource retention status
	LINK_RR_STATUS_TYPE=43,
	///Info query binary data list
	IQ_BIN_DATA_LIST_TYPE=44,
	///Info query RDF data list
	IQ_RDF_DATA_LIST_TYPE=45,
	///Info query RDF schema URL
	IQ_RDF_SCHM_URL_TYPE=46,
	///Info query RDF schema list
	IQ_RDF_SCHM_LIST_TYPE=47,
	///Max response size
	MAX_RSP_SIZE_TYPE=48,
	///Info response binary data list
	IR_BIN_DATA_LIST_TYPE=49,
	///Info response RDF data list
	IR_RDF_DATA_LIST_TYPE=50,
	///Info response RDF schema URL list
	IR_SCHM_URL_LIST_TYPE=51,
	///Info response RDF schema list
	IR_RDF_SCHM_LIST_TYPE=52,
	///Mobile node MIHF ID
	MN_MIHF_ID_TYPE=53,
	///Query resource report flag
	QRY_RSP_FLAG_TYPE=54,
	///Event configuration info list
	EVT_CFG_INFO_LIST_TYPE=55,
	///Target network info
	TGT_NET_INFO_TYPE=56,
	///List of target network info
	TGT_NET_INFO_LIST_TYPE=57,
	///Assigned resource set
	ASGN_RES_SET_TYPE=58,
	///Link detected info list
	LINK_DET_INFO_LIST_TYPE=59,
	///MN link ID
	MN_LINK_ID_TYPE=60,
	///PoA
	POA_LINK_ADDR_TYPE=61,
	///Unauthenticated information request
	UNAUTH_INFO_RQST_TYPE=62,
	///Network type
	NETWORK_TYPE_TYPE=63,
	///Requested resource set
	REQ_RES_SET_TYPE=64
	
}tlv_type;

typedef struct _generic_tlv {
	//char *name;
	unsigned long type; // 32 bits
	unsigned int tlv_length;
	
	char *value; // TLV raw data
	unsigned int data_payload_length; // TLV raw data length (max 65535)
	
}generic_tlv;

#endif 